using System;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using 道路运输从业人员无纸化考试系统.Properties;

namespace 道路运输从业人员无纸化考试系统
{
	public class ResultForm : Form
	{
		private IContainer components = null;

		private Label lblname;

		private Label lblcode;

		private Label lblmode;

		private Label lblresult;

		private Label lblIsOK;

		private Label lblcode2;

		private Button btnClose;

		private string stuname;

		private string no;

		private string mode;

		private string result;

		public string Stuname
		{
			get
			{
				return stuname;
			}
			set
			{
				stuname = value;
			}
		}

		public string No
		{
			get
			{
				return no;
			}
			set
			{
				no = value;
			}
		}

		public string Mode
		{
			get
			{
				return mode;
			}
			set
			{
				mode = value;
			}
		}

		public string Result
		{
			get
			{
				return result;
			}
			set
			{
				result = value;
			}
		}

		protected override void Dispose(bool disposing)
		{
			if (disposing && components != null)
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		private void InitializeComponent()
		{
			lblname = new System.Windows.Forms.Label();
			lblcode = new System.Windows.Forms.Label();
			lblmode = new System.Windows.Forms.Label();
			lblresult = new System.Windows.Forms.Label();
			lblIsOK = new System.Windows.Forms.Label();
			lblcode2 = new System.Windows.Forms.Label();
			btnClose = new System.Windows.Forms.Button();
			SuspendLayout();
			lblname.AutoSize = true;
			lblname.BackColor = System.Drawing.Color.Transparent;
			lblname.Location = new System.Drawing.Point(12, 73);
			lblname.Name = "lblname";
			lblname.Size = new System.Drawing.Size(41, 12);
			lblname.TabIndex = 0;
			lblname.Text = "label1";
			lblcode.AutoSize = true;
			lblcode.BackColor = System.Drawing.Color.Transparent;
			lblcode.Location = new System.Drawing.Point(91, 73);
			lblcode.Name = "lblcode";
			lblcode.Size = new System.Drawing.Size(41, 12);
			lblcode.TabIndex = 0;
			lblcode.Text = "label1";
			lblmode.AutoSize = true;
			lblmode.BackColor = System.Drawing.Color.Transparent;
			lblmode.Location = new System.Drawing.Point(328, 73);
			lblmode.Name = "lblmode";
			lblmode.Size = new System.Drawing.Size(41, 12);
			lblmode.TabIndex = 0;
			lblmode.Text = "label1";
			lblresult.AutoSize = true;
			lblresult.BackColor = System.Drawing.Color.Transparent;
			lblresult.Location = new System.Drawing.Point(473, 73);
			lblresult.Name = "lblresult";
			lblresult.Size = new System.Drawing.Size(41, 12);
			lblresult.TabIndex = 0;
			lblresult.Text = "label1";
			lblIsOK.AutoSize = true;
			lblIsOK.BackColor = System.Drawing.Color.Transparent;
			lblIsOK.Location = new System.Drawing.Point(541, 73);
			lblIsOK.Name = "lblIsOK";
			lblIsOK.Size = new System.Drawing.Size(41, 12);
			lblIsOK.TabIndex = 0;
			lblIsOK.Text = "label1";
			lblcode2.AutoSize = true;
			lblcode2.BackColor = System.Drawing.Color.Transparent;
			lblcode2.Location = new System.Drawing.Point(239, 73);
			lblcode2.Name = "lblcode2";
			lblcode2.Size = new System.Drawing.Size(41, 12);
			lblcode2.TabIndex = 0;
			lblcode2.Text = "label1";
			btnClose.BackColor = System.Drawing.Color.Transparent;
			btnClose.Location = new System.Drawing.Point(276, 95);
			btnClose.Name = "btnClose";
			btnClose.Size = new System.Drawing.Size(40, 23);
			btnClose.TabIndex = 1;
			btnClose.Text = "关闭";
			btnClose.UseVisualStyleBackColor = false;
			btnClose.Click += new System.EventHandler(btnClose_Click);
			base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
			base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			BackColor = System.Drawing.Color.White;
			BackgroundImage = 道路运输从业人员无纸化考试系统.Properties.Resources.result2;
			base.ClientSize = new System.Drawing.Size(594, 201);
			base.Controls.Add(btnClose);
			base.Controls.Add(lblIsOK);
			base.Controls.Add(lblresult);
			base.Controls.Add(lblmode);
			base.Controls.Add(lblcode2);
			base.Controls.Add(lblcode);
			base.Controls.Add(lblname);
			base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
			base.MaximizeBox = false;
			base.Name = "ResultForm";
			base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			Text = "道路运输从业人员无纸化考试系统--成绩显示";
			base.Load += new System.EventHandler(ResultForm_Load);
			ResumeLayout(false);
			PerformLayout();
		}

		public ResultForm()
		{
			InitializeComponent();
		}

		public ResultForm(string stuname, string no, string mode, string result)
		{
			InitializeComponent();
			this.stuname = stuname;
			this.no = no;
			this.mode = mode;
			this.result = result;
		}

		private void ResultForm_Load(object sender, EventArgs e)
		{
			lblname.Text = Stuname;
			lblcode.Text = No;
			if (No.Length > 6)
			{
				lblcode2.Text = No.Substring(No.Length - 6);
			}
			else
			{
				lblcode2.Text = No;
			}
			lblmode.Text = Mode;
			lblresult.Text = Result;
			DataTable dtsys = GlobamParms.GetSystems();
			double OKfenzhi = double.Parse(dtsys.Rows[0][1].ToString());
			if (double.Parse(Result) >= OKfenzhi)
			{
				lblIsOK.Text = "合格";
			}
			else
			{
				lblIsOK.Text = "不合格";
			}
		}

		private void btnClose_Click(object sender, EventArgs e)
		{
			Close();
		}
	}
}
